﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Cofe.Core.Implements;

namespace Cofe.Core.Tasks
{
    public interface ITaskManager : ICofeService
    {
        TaskScheduler TaskScheduler { get; }
        ITaskConstructor TaskConstructor { get; }

        Task InvokeAsync(PropertyPair ppair, ParameterDic parameters);
        Task<T> InvokeAsync<T>(PropertyPair ppair, ParameterDic parameters);

        void AbortAll();
        Task StartAsync(Task task);
        Task<T> StartAsync<T>(Task<T> task);
        void StartRepeat(Action<CancellationToken> action, TimeSpan waitTime, CancellationToken token, int threads = 1);

    }

}
